package com.cloud.base.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * @author dhg
 * @Description
 * @createTime 2022年09月27日 10:07:00
 */
@Data
@Configuration
public class OssConfig {
    @Value("${oss.endpoint}")
    private String endpoint;
    @Value("${oss.accessKeyId}")
    private String accessKeyId;
    @Value("${oss.accessKeySecret}")
    private String accessKeySecret;
    @Value("${oss.bucketName}")
    private String bucketName;
    @Value("${oss.roleArn}")
    private String roleArn;
    @Value("${oss.regionId}")
    private String regionId;

    @Value("${oss.endpoint2}")
    private String endpoint2;

    public OSS getOssClient(){
        return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }
}
